<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>管理系统</title>
<!-- Tell the browser to be responsive to screen width -->
<meta
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
	name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet"
	href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet"
	href="../bower_components/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet"
	href="../bower_components/Ionicons/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
<!-- <link rel="stylesheet" th:href="@{/plugins/datepicker/datepicker3.css}" href="../plugins/datepicker/datepicker3.css"> -->
<link rel="stylesheet"
	th:href="@{/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css}">
<!-- Google Font -->
<link rel="stylesheet"
	href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">
		<div th:replace="~{admin/templates/header::.main-header}"></div>
		<aside class="main-sidebar"
			th:include="~{admin/templates/aside::.main-sidebar}"
			th:with="onevar='research-platform'"></aside>
		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>科研平台</h1>
				<ol class="breadcrumb">
					<li><a th:href="@{/admin}"><i class="fa fa-dashboard"></i>
							首页</a></li>
					<li class="active">科研平台</li>
				</ol>
			</section>
			<section class="content">
				<div class="box box-info">
					<div class="box-header with-border">
						<h3 class="box-title">编辑</h3>
					</div>
					<form th:action="@{/admin/add-research-platform}" th:method="post"
						enctype="multipart/form-data">
						<div class="box-body">
							<div class="col-lg-6">
								<div class="form-group" style="padding: 0 10px 0 0">
									<label>标题:</label> <input type="text" name="title"
										class="form-control" th:value="*{title}">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<div class="form-group" style="padding: 0 10px 0 0">
									<label>分类:</label> <select class="form-control"
										name="categoryId" th:value="*{categoryId}">
										<option th:value="${item.id}" th:each="item:${categorieList}"
											th:text="${item.name}">国家级平台建设</option>
									</select>
								</div>
							</div>
							<div class="form-group col-lg-12">
								<label>内容:</label>
								<script id="editor" type="text/plain"
									style="width: 100%; height: 500px;" name="content"></script>
							</div>
						</div>
						<div class="box-footer">
							<button type="submit" class="btn btn-primary pull-right">保存</button>
						</div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<!-- jQuery 3 -->
	<script src="../bower_components/jquery/dist/jquery.min.js"></script>
	<!-- Bootstrap 3.3.7 -->
	<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
	<!-- FastClick -->
	<script src="../bower_components/fastclick/lib/fastclick.js"></script>
	<!-- AdminLTE App -->
	<script src="../dist/js/adminlte.min.js"></script>
	<!-- AdminLTE for demo purposes -->
	<script src="../dist/js/demo.js"></script>
	<!-- 	<script th:src="@{/plugins/datepicker/bootstrap-datepicker.js}" src="../plugins/datepicker/bootstrap-datepicker.js"></script> -->
	<script type="text/javascript"
		th:src="@{/bower_components/moment/min/moment.min.js}"
		src="/bower_components/moment/min/moment.min.js"></script>
	<script type="text/javascript"
		th:src="@{/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js}"
		src="/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
	<script type="text/javascript" th:src="@{/js/dateformat.js}"
		src="/js/dateformat.js"></script>
	<script type="text/javascript" charset="utf-8"
		th:src="@{/ueditor/ueditor.config.js}" src="/js/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8"
		th:src="@{/ueditor/ueditor.all.min.js}" src="/js/ueditor.all.min.js">
		
	</script>
	<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
	<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
	<script type="text/javascript" charset="utf-8"
		th:src="@{/ueditor/lang/zh-cn/zh-cn.js}" src="lang/zh-cn/zh-cn.js"></script>
	<script type="text/javascript">
		UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
		UE.Editor.prototype.getActionUrl = function(action) {
			if (action == 'uploadimage' || action == 'uploadscrawl'
					|| action == 'uploadimage') {
				return 'http://www.cdyjy.uestc.edu.cn/ueditor/uploadimage?action=uploadimage';
			} else if (action == 'uploadvideo') {
				return 'http://a.b.com/video.php';
			} else {
				return this._bkGetActionUrl.call(this, action);
			}
		}

		//实例化编辑器
		//建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
		var ue = UE.getEditor('editor');
	</script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("select").change(function() {
				if ($(this).val() == 0) {
					$("#img-input").removeAttr("disabled");
				} else {
					$("#img-input").attr("disabled", "disabled");
				}
			});
		})
	</script>
	<script type="text/javascript">
		$(document).ready(function() {
			$('#datetimepicker').datetimepicker({
				format : 'YYYY-MM-DD HH:mm'
			});
		})
	</script>
</body>
</html>